#ifndef LAURIN_IP_NETWORK_H_
#define LAURIN_IP_NETWORK_H_

#include "laurin-ip-range.h"
#include "laurin-network-client.h"
#include <list>
#include <sys/types.h>


class LaurinIPNetwork
{
	public:

		LaurinIPNetwork(u_int32_t address, u_int32_t subnetMask);
		virtual ~LaurinIPNetwork();

		u_int32_t getNetworkAddress() const;
		u_int32_t getNetworkSubnetMask() const;
		LaurinIPRange* getNetworkIPRange() const;

		void addClient(const LaurinNetworkClient& client, bool checkPresent = true);
		bool isClientPresent(u_int32_t ip);


		const std::list<LaurinNetworkClient>& getClients() const;
		int getNumberOfClients() const;

		void clear();


	private:

		u_int32_t _address;
		u_int32_t _mask;
		LaurinIPRange* _range;

		std::list<LaurinNetworkClient> _clients;

};


#endif
